﻿using System;
using Samples.Radio.Data;

namespace Samples.Radio
{

    public class PodcastViewModel : NotifyBase
    {
        private string _Title;
        public string Title
        {
            get
            {
                return _Title;
            }
            set
            {
                _Title = value;
                RaisePropertyChanged(() => Title);
                RaisePropertyChanged(() => ProgramName);
            }
        }

        public string ProgramName
        {
            get
            {
                return _Title;
            }
        }

        private string _Description;
        public string Description
        {
            get
            {
                return _Description;
            }
            set
            {
                _Description = value;
                RaisePropertyChanged(() => Description);
            }
        }

        private string _Keywords;
        public string Keywords
        {
            get
            {
                return _Keywords;
            }
            set
            {
                _Keywords = value;
                RaisePropertyChanged(() => Keywords);
            }
        }

        private String _Date;
        public String Date
        {
            get
            {
                return _Date;
            }
            set
            {
                _Date = value;
                RaisePropertyChanged(() => Date);
                RaisePropertyChanged(() => PodcastAge);
            }
        }

        public String PodcastAge
        {
            get
            {
                return _Date;
            }
        
        }

        public DateTime ParsedDate
        {
            get
            {

                DateTime currentDate = DateTime.Now;
                if (_Date != null)
                {
                    DateTime.TryParse(_Date, out currentDate);
                }

                return currentDate;
            }
        }

        private string _ProgramImage;
        public string ProgramImage
        {
            get
            {
                return _ProgramImage;
            }
            set
            {
                _ProgramImage = value;
                RaisePropertyChanged(() => ProgramImage);
            }
        }

        private string _PodcastUrl;
        public string PodcastUrl
        {
            get
            {
                return _PodcastUrl;
            }
            set
            {
                _PodcastUrl = value;
                RaisePropertyChanged(() => PodcastUrl);
            }
        }


    }
}